package com.tramy.hpush.server.data;

import com.google.gson.annotations.SerializedName;

import java.util.ArrayList;
import java.util.List;

public class AndroidNotification {
    @SerializedName("title")
    private String title;

    @SerializedName("body")
    private String body;

    @SerializedName("icon")
    private String icon;

    @SerializedName("color")
    private String color;

    @SerializedName("sound")
    private String sound;

    @SerializedName("default_sound")
    private Boolean defaultSound;

    @SerializedName("click_action")
    private ClickAction clickAction;

    @SerializedName("channel_id")
    private String channelId;

    @SerializedName("notify_summary")
    private String notifySummary;

    @SerializedName("image")
    private String image;

    @SerializedName("style")
    private Integer style;

    @SerializedName("big_title")
    private String bigTitle;

    @SerializedName("big_body")
    private String bigBody;

    @SerializedName("auto_clear")
    private Integer autoClear;

    @SerializedName("notify_id")
    private Integer notifyId;

    @SerializedName("group")
    private String group;

    @SerializedName("badge")
    private BadgeNotification badge;

    @SerializedName("ticker")
    private String ticker;

    @SerializedName("when")
    private String when;

    @SerializedName("importance")
    private String importance;

    @SerializedName("use_default_vibrate")
    private Boolean useDefaultVibrate;

    @SerializedName("use_default_light")
    private Boolean useDefaultLight;

    @SerializedName("vibrate_config")
    private List<String> vibrateConfig;

    @SerializedName("visibility")
    private String visibility;

    @SerializedName("foreground_show")
    private Boolean foregroundShow;

    @SerializedName("inbox_content")
    private List<String> inboxContent;

    private AndroidNotification(Builder builder) {
        this.title = builder.title;
        this.body = builder.body;
        this.icon = builder.icon;
        this.color = builder.color;
        this.sound = builder.sound;
        this.defaultSound = builder.defaultSound;

        this.clickAction = builder.clickAction;

        this.channelId = builder.channelId;

        this.notifySummary = builder.notifySummary;
        this.image = builder.image;
        this.style = builder.style;
        this.bigTitle = builder.bigTitle;
        this.bigBody = builder.bigBody;
        this.autoClear = builder.autoClear;
        this.notifyId = builder.notifyId;
        this.group = builder.group;

        this.badge = builder.badge;

        this.ticker = builder.ticker;
        this.when = builder.when;
        this.importance = builder.importance;
        this.useDefaultVibrate = builder.useDefaultVibrate;
        this.useDefaultLight = builder.useDefaultLight;

        this.vibrateConfig = builder.vibrateConfig;

        this.visibility = builder.visibility;
        this.foregroundShow = builder.foregroundShow;

        this.inboxContent = builder.inboxContent;
    }

    public String getTitle() {
        return title;
    }

    public String getBody() {
        return body;
    }

    public String getIcon() {
        return icon;
    }

    public String getColor() {
        return color;
    }

    public String getSound() {
        return sound;
    }

    public Boolean isDefaultSound() {
        return defaultSound;
    }

    public ClickAction getClickAction() {
        return clickAction;
    }

    public String getChannelId() {
        return channelId;
    }

    public String getNotifySummary() {
        return notifySummary;
    }

    public String getImage() {
        return image;
    }

    public Integer getStyle() {
        return style;
    }

    public String getBigTitle() {
        return bigTitle;
    }

    public String getBigBody() {
        return bigBody;
    }

    public Integer getAutoClear() {
        return autoClear;
    }

    public Integer getNotifyId() {
        return notifyId;
    }

    public String getGroup() {
        return group;
    }

    public BadgeNotification getBadge() {
        return badge;
    }

    public String getTicker() {
        return ticker;
    }

    public String getWhen() {
        return when;
    }

    public String getImportance() {
        return importance;
    }

    public List<String> getVibrateConfig() {
        return vibrateConfig;
    }

    public Boolean isUseDefaultVibrate() {
        return useDefaultVibrate;
    }

    public Boolean isUseDefaultLight() {
        return useDefaultLight;
    }

    public String getVisibility() {
        return visibility;
    }

    public Boolean isForegroundShow() {
        return foregroundShow;
    }

    public List<String> getInboxContent() {
        return inboxContent;
    }

    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private String title;
        private String body;
        private String icon;
        private String color;
        private String sound;
        private Boolean defaultSound;
        private ClickAction clickAction;
        private String channelId;
        private String notifySummary;
        private String image;
        private Integer style;
        private String bigTitle;
        private String bigBody;
        private Integer autoClear;
        private Integer notifyId;
        private String group;

        private BadgeNotification badge;

        private String ticker;
        private String when;
        private String importance;
        private Boolean useDefaultVibrate;
        private Boolean useDefaultLight;
        private List<String> vibrateConfig;
        private String visibility;
        private Boolean foregroundShow;

        private List<String> inboxContent;

        private Builder() {

        }

        public Builder setTitle(String title) {
            this.title = title;
            return this;
        }

        public Builder setBody(String body) {
            this.body = body;
            return this;
        }

        public Builder setIcon(String icon) {
            this.icon = icon;
            return this;
        }

        public Builder setColor(String color) {
            this.color = color;
            return this;
        }

        public Builder setSound(String sound) {
            this.sound = sound;
            return this;
        }

        public Builder setDefaultSound(Boolean defaultSound) {
            this.defaultSound = defaultSound;
            return this;
        }

        public Builder setClickAction(ClickAction clickAction) {
            this.clickAction = clickAction;
            return this;
        }

        public Builder setChannelId(String channelId) {
            this.channelId = channelId;
            return this;
        }

        public Builder setNotifySummary(String notifySummary) {
            this.notifySummary = notifySummary;
            return this;
        }

        public Builder setImage(String image) {
            this.image = image;
            return this;
        }

        public Builder setStyle(Integer style) {
            this.style = style;
            return this;
        }

        public Builder setBigTitle(String bigTitle) {
            this.bigTitle = bigTitle;
            return this;
        }

        public Builder setBigBody(String bigBody) {
            this.bigBody = bigBody;
            return this;
        }

        public Builder setAutoClear(Integer autoClear) {
            this.autoClear = autoClear;
            return this;
        }

        public Builder setNotifyId(Integer notifyId) {
            this.notifyId = notifyId;
            return this;
        }

        public Builder setGroup(String group) {
            this.group = group;
            return this;
        }

        public Builder setBadge(BadgeNotification badge) {
            this.badge = badge;
            return this;
        }

        public Builder setTicker(String ticker) {
            this.ticker = ticker;
            return this;
        }

        public Builder setWhen(String when) {
            this.when = when;
            return this;
        }

        public Builder setImportance(String importance) {
            this.importance = importance;
            return this;
        }

        public Builder setUseDefaultVibrate(Boolean useDefaultVibrate) {
            this.useDefaultVibrate = useDefaultVibrate;
            return this;
        }

        public Builder setUseDefaultLight(Boolean useDefaultLight) {
            this.useDefaultLight = useDefaultLight;
            return this;
        }

        public Builder addVibrateConfig(String vibrateTiming) {
            if (this.vibrateConfig == null) {
                this.vibrateConfig = new ArrayList<>();
            }
            this.vibrateConfig.add(vibrateTiming);
            return this;
        }

        public Builder addAllVibrateConfig(List<String> vibrateTimings) {
            if (this.vibrateConfig == null) {
                this.vibrateConfig = new ArrayList<>();
            }
            this.vibrateConfig.addAll(vibrateTimings);
            return this;
        }

        public Builder setVisibility(String visibility) {
            this.visibility = visibility;
            return this;
        }

        public Builder setForegroundShow(Boolean foregroundShow) {
            this.foregroundShow = foregroundShow;
            return this;
        }

        public Builder addInboxContent(String inboxContent) {
            if (this.inboxContent == null) {
                this.inboxContent = new ArrayList<>();
            }
            this.inboxContent.add(inboxContent);
            return this;
        }

        public Builder addAllInboxContent(List<String> inboxContents) {
            if (this.inboxContent == null) {
                this.inboxContent = new ArrayList<>();
            }
            this.inboxContent.addAll(inboxContents);
            return this;
        }

        public AndroidNotification build() {
            return new AndroidNotification(this);
        }
    }

}
